from django.urls.conf import path, include
from rest_framework.routers import SimpleRouter, DefaultRouter
from user import views
from django.urls import path, include
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .views import HomeStatsViewSet



# 创建一个 路由管理对象
# trailing_slash是否要在生成的路由尾部添加'/'
router = SimpleRouter(trailing_slash=False)

router.register('user', views.UserViewSet, basename='user')

router.register(r'student', views.StudentViewSet, basename='student')

router.register('module', views.ModuleViewSet, basename='module')

router.register('role', views.RoleViewSet, basename='role')

router.register('language',views.LanguageViewSet,basename='language')

router.register('clazz', views.ClazzViewSet, basename='clazz')

router.register('func', views.FuncViewSet, basename='func')

router.register('menu', views.MenuViewSet, basename='menu')

router.register('permission', views.PermissionViewSet, basename='permission')

router.register('task_manage',views.TaskViewSet,basename='task_manage')

router.register('class-count', views.ClassCountViewSet, basename='class-count')

router.register('difficulty-level', views.DifficultyLevelViewSet, basename='difficulty-level')

router.register('task-completion', views.TaskCompletionViewSet, basename='task-completion')

router.register('task-status', views.TaskStatusViewSet, basename='task-status')

router.register(r'home/stats', HomeStatsViewSet, basename='home-stats')

router.register(r"studentManage",views.StudentManageViewSet,basename='studentManage')

router.register(r"clazzs",views.ClazzsViewSet,basename='clazzs')

urlpatterns = [
    path('', include(router.urls)),
]